import {
    insuranceFundFileProcessStatus as processStatus,
    insuranceFundFileProcessStatusEnum as processEnum
} from '@/pages/SalaryManage/enum';
import { Tag } from 'antd';
import React from 'react';
import salaryStyle from '@/pages/SalaryManage/salaryManage.less';
import classNames from 'classnames';

const ProcessStatusTag = ({ status, style, className, children }) => {
    const statusMapper = {
        // 编辑中
        [processStatus.EDIT]: {
            color: 'cyan'
        },
        // 审批中
        [processStatus.APPROVING]: {
            color: 'orange',
            tip: true
        },
        // 已生效
        [processStatus.EFFECT]: {
            color: 'green'
        },
        // 待生效
        [processStatus.EFFECTING]: {
            color: 'orange'
        }
    };

    const statusConfig = statusMapper[status] || {};

    return (
        <Tag color={statusConfig.color} className={classNames(salaryStyle.noBorderTag, className)} style={style}>
            {processEnum.getShowName(status)}{children}
        </Tag>
    );
};

export default ProcessStatusTag;
